package com.cx.service.serviceimp;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.cx.entity.Category;
import com.cx.mapper.CategoryMapper;
import com.cx.service.CategoryService;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Resource
    private CategoryMapper categoryMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return categoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Category record) {
        return categoryMapper.insert(record);
    }

    @Override
    public int insertOrUpdate(Category record) {
        return categoryMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(Category record) {
        return categoryMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(Category record) {
        return categoryMapper.insertSelective(record);
    }

    @Override
    public Category selectByPrimaryKey(Integer id) {
        return categoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Category record) {
        return categoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Category record) {
        return categoryMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateBatch(List<Category> list) {
        return categoryMapper.updateBatch(list);
    }

    @Override
    public int batchInsert(List<Category> list) {
        return categoryMapper.batchInsert(list);
    }

    @Override
    public List<Category> paging(Integer pageNum, Integer pageSize) {
        int offset = (pageNum - 1) * pageSize;
        return categoryMapper.paging(offset, pageSize);
    }

}
